import time
import threading

class MyThread(threading.Thread):

    def run(self):
        time.sleep(3)
        print(f"重写线程run()方法,线程名称：{self.name}")


# 循环执行多个线程
def test():
    for i in range(3):
        t = MyThread()
        t.start()

if __name__ == '__main__':
    t = MyThread()
    t.start()



